package com.wealth.scsj.p_app.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.wealth.scsj.p_app.R;
import com.wealth.scsj.p_app.bean.ReturnDepositDetailsBean;

import java.util.List;

/**
 * 退款详情adapter
 */
public class ReturnDepositDetailsAdapter extends RecyclerView.Adapter<ReturnDepositDetailsAdapter.MyViewHolder> {

    private Context mContext;
    private List<ReturnDepositDetailsBean> mList;
    private LayoutInflater mInflater;
    SwitchOnClick switchOnClick;

    public ReturnDepositDetailsAdapter(Context context, List<ReturnDepositDetailsBean> data) {
        this.mContext = context;
        this.mList = data;
        mInflater = LayoutInflater.from(context);
    }

    public void setSwitchOnClick(SwitchOnClick switchOnClick) {
        this.switchOnClick = switchOnClick;
    }
    @Override
    public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = mInflater.inflate(R.layout.item_deposit_details, parent, false);
        MyViewHolder viewHolder = new MyViewHolder(view);
        return viewHolder;
    }

    @Override
    public void onBindViewHolder(MyViewHolder holder, final int position) {
    }

    @Override
    public int getItemCount() {
        return mList.size();
    }

    public class MyViewHolder extends RecyclerView.ViewHolder {

        public TextView mReturnDepositMoneyTv;
        public TextView mDepositAccountTv;
        public TextView mDepositDataTv;


        public MyViewHolder(View itemView) {
            super(itemView);
            mReturnDepositMoneyTv =itemView.findViewById(R.id.return_deposit_money_tv);
            mDepositAccountTv =itemView.findViewById(R.id.deposit_account_tv);
            mDepositDataTv =itemView.findViewById(R.id.deposit_data_tv);
        }
    }

    public interface SwitchOnClick{
        void onclick(int position);
    }
}
